package com.liuyi.netty.im.commons.codes.data.event;

import com.liuyi.netty.im.commons.codes.CodeConst;
import com.liuyi.netty.im.commons.codes.data.event.message.playload.Playload;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * 消息体
 *
 * @author Mr.Fmy
 * @since 2021-12-07
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
public class Message<T extends Playload> implements Serializable {

    private static final long serialVersionUID = -2093047166639806140L;

    /**
     * 消息唯一id
     */
    private String messageId;

    /**
     * 发送方信息
     */
    private Object fromProfile;

    /**
     * 发送方 userid
     */
    private String fromId;

    /**
     * 接收方 userid
     */
    private String toId;

    /**
     * 会话
     */
    private String sessionId;

    /**
     * 会话类型
     */
    private CodeConst.SessionType sessionType;

    /**
     * 消息类型
     */
    private CodeConst.MsgType msgType;

    /**
     * 消息流向
     */
    private CodeConst.MsgFlow msgFlow;

    /**
     * 消息创建时间
     */
    private Long createTime;

    /**
     * 消息体
     */
    private T playload;


}
